<?php
/**
 * Description of Administrador
 *
 * @author gonxa
 */
class Administrador extends CI_Controller{
    
    public function __construct() {
        parent::__construct();
        if($this->session->userdata("admin")){
            $data = array(
                'error' => 'Usuario no autorizado'
            );
            $this->twig->display("login.html",$data);
            exit();
        }
    }
    
    
    public function index(){
        $this->load->model('seccion');        
        $data = array('secciones'=>$this->seccion->getLista());
        $this->twig->display('admin/index.html',$data);
    }
    
    public function galeria($id_seccion){
        $this->load->model('galeria');
        $data = array('galerias'=>$this->galeria->getLista($id_seccion));
        $this->twig->display('admin/galerias.html',$data);
    }
    
    
}

?>
